<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>sampleFile - OpenGrok cross reference for /sampleFile</title></head><body>
<script type="text/javascript">/* <![CDATA[ */
function get_sym_list(){return [["Function","xf",[["abstime_to_reltime",70],["hrt2ts",40]]]];} /* ]]> */</script><a class="l" name="1" href="#1">1</a><span class='fold-space'>&nbsp;</span><span class="c">/*
<a class="l" name="2" href="#2">2</a><span class='fold-space'>&nbsp;</span> * CDDL HEADER START
<a class="l" name="3" href="#3">3</a><span class='fold-space'>&nbsp;</span> *
<a class="l" name="4" href="#4">4</a><span class='fold-space'>&nbsp;</span> * The contents of this file are subject to the terms of the
<a class="l" name="5" href="#5">5</a><span class='fold-space'>&nbsp;</span> * Common Development and Distribution License, Version 1.0 only
<a class="l" name="6" href="#6">6</a><span class='fold-space'>&nbsp;</span> * (the &quot;License&quot;).  You may not use this file except in compliance
<a class="l" name="7" href="#7">7</a><span class='fold-space'>&nbsp;</span> * with the License.
<a class="l" name="8" href="#8">8</a><span class='fold-space'>&nbsp;</span> *
<a class="l" name="9" href="#9">9</a><span class='fold-space'>&nbsp;</span> * You can obtain a copy of the license at <a href="/source/s?path=usr/">usr</a>/<a href="/source/s?path=usr/src/">src</a>/<a href="/source/s?path=usr/src/OPENSOLARIS.LICENSE">OPENSOLARIS.LICENSE</a>
<a class="hl" name="10" href="#10">10</a><span class='fold-space'>&nbsp;</span> * or <a href="http://www.opensolaris.org/os/licensing">http://www.opensolaris.org/os/licensing</a>.
<a class="l" name="11" href="#11">11</a><span class='fold-space'>&nbsp;</span> * See the License for the specific language governing permissions
<a class="l" name="12" href="#12">12</a><span class='fold-space'>&nbsp;</span> * and limitations under the License.
<a class="l" name="13" href="#13">13</a><span class='fold-space'>&nbsp;</span> *
<a class="l" name="14" href="#14">14</a><span class='fold-space'>&nbsp;</span> * When distributing Covered Code, include this CDDL HEADER in each
<a class="l" name="15" href="#15">15</a><span class='fold-space'>&nbsp;</span> * file and include the License file at <a href="/source/s?path=usr/">usr</a>/<a href="/source/s?path=usr/src/">src</a>/<a href="/source/s?path=usr/src/OPENSOLARIS.LICENSE">OPENSOLARIS.LICENSE</a>.
<a class="l" name="16" href="#16">16</a><span class='fold-space'>&nbsp;</span> * If applicable, add the following below this CDDL HEADER, with the
<a class="l" name="17" href="#17">17</a><span class='fold-space'>&nbsp;</span> * fields enclosed by brackets &quot;[]&quot; replaced with your own identifying
<a class="l" name="18" href="#18">18</a><span class='fold-space'>&nbsp;</span> * information: Portions Copyright [yyyy] [name of copyright owner]
<a class="l" name="19" href="#19">19</a><span class='fold-space'>&nbsp;</span> *
<a class="hl" name="20" href="#20">20</a><span class='fold-space'>&nbsp;</span> * CDDL HEADER END
<a class="l" name="21" href="#21">21</a><span class='fold-space'>&nbsp;</span> */</span>
<a class="l" name="22" href="#22">22</a><span class='fold-space'>&nbsp;</span><span class="c">/*
<a class="l" name="23" href="#23">23</a><span class='fold-space'>&nbsp;</span> * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
<a class="l" name="24" href="#24">24</a><span class='fold-space'>&nbsp;</span> * Use is subject to license terms.
<a class="l" name="25" href="#25">25</a><span class='fold-space'>&nbsp;</span> */</span>
<a class="l" name="26" href="#26">26</a><span class='fold-space'>&nbsp;</span>
<a class="l" name="27" href="#27">27</a><span class='fold-space'>&nbsp;</span>#<b>pragma</b> <b>ident</b>	<span class="s">&quot;%Z%%M%	%I%	%E% SMI&quot;</span>
<a class="l" name="28" href="#28">28</a><span class='fold-space'>&nbsp;</span>
<a class="l" name="29" href="#29">29</a><span class='fold-space'>&nbsp;</span>#<b>include</b> &lt;<a href="/source/s?path=sys/">sys</a>/<a href="/source/s?path=sys/types.h">types.h</a>&gt;
<a class="hl" name="30" href="#30">30</a><span class='fold-space'>&nbsp;</span>#<b>include</b> &lt;<a href="/source/s?path=time.h">time.h</a>&gt;
<a class="l" name="31" href="#31">31</a><span class='fold-space'>&nbsp;</span>#<b>include</b> &quot;<a href="/source/s?path=errno.ext1">errno.ext1</a>&quot;
<a class="l" name="32" href="#32">32</a><span class='fold-space'>&nbsp;</span>
<a class="l" name="33" href="#33">33</a><span class='fold-space'>&nbsp;</span><span class="c">/*
<a class="l" name="34" href="#34">34</a><span class='fold-space'>&nbsp;</span> * This function is blatently stolen from the kernel.
<a class="l" name="35" href="#35">35</a><span class='fold-space'>&nbsp;</span> * See the dissertation in the comments preceding the
<a class="l" name="36" href="#36">36</a><span class='fold-space'>&nbsp;</span> * hrt2ts() function in:
<a class="l" name="37" href="#37">37</a><span class='fold-space'>&nbsp;</span> *	<a href="/source/s?path=uts/">uts</a>/<a href="/source/s?path=uts/common/">common</a>/<a href="/source/s?path=uts/common/os/">os</a>/<a href="/source/s?path=uts/common/os/timers.c">timers.c</a>
<a class="l" name="38" href="#38">38</a><span class='fold-space'>&nbsp;</span> */</span>
<a class="l" name="39" href="#39">39</a><span class='fold-space'>&nbsp;</span><b>void</b>
<span id='scope_id_6d8e64a0' class='scope-head'><span class='scope-signature'>hrt2ts(hrtime_t hrt,timespec_t * tsp)</span><a class="hl" name="40" href="#40">40</a><a style='cursor:pointer;' onclick='fold(this.parentNode.id)' id='scope_id_6d8e64a0_fold_icon'><span class='fold-icon'>&nbsp;</span></a><a class="xf" name="hrt2ts"/><a href="/source/s?refs=hrt2ts" class="xf intelliWindow-symbol" data-definition-place="def">hrt2ts</a>(<a href="/source/s?defs=hrtime_t" class="intelliWindow-symbol" data-definition-place="undefined-in-file">hrtime_t</a> <a class="xa" name="hrt"/><a href="/source/s?refs=hrt" class="xa intelliWindow-symbol" data-definition-place="def">hrt</a>, <a href="/source/s?defs=timespec_t" class="intelliWindow-symbol" data-definition-place="undefined-in-file">timespec_t</a> *<a class="xa" name="tsp"/><a href="/source/s?refs=tsp" class="xa intelliWindow-symbol" data-definition-place="def">tsp</a>)</span>
<span id='scope_id_6d8e64a0_fold' class='scope-body'><a class="l" name="41" href="#41">41</a><span class='fold-space'>&nbsp;</span>&#123;
<a class="l" name="42" href="#42">42</a><span class='fold-space'>&nbsp;</span>	<a href="/source/s?defs=uint32_t" class="intelliWindow-symbol" data-definition-place="undefined-in-file">uint32_t</a> <a class="xl" name="sec"/><a href="/source/s?refs=sec" class="xl intelliWindow-symbol" data-definition-place="def">sec</a>, <a class="xl" name="nsec"/><a href="/source/s?refs=nsec" class="xl intelliWindow-symbol" data-definition-place="def">nsec</a>, <a class="xl" name="tmp"/><a href="/source/s?refs=tmp" class="xl intelliWindow-symbol" data-definition-place="def">tmp</a>&#59;
<a class="l" name="43" href="#43">43</a><span class='fold-space'>&nbsp;</span>
<a class="l" name="44" href="#44">44</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a> = (<a href="/source/s?defs=uint32_t" class="intelliWindow-symbol" data-definition-place="undefined-in-file">uint32_t</a>)(<a class="d intelliWindow-symbol" href="#hrt" data-definition-place="defined-in-file">hrt</a> &gt;&gt; <span class="n">30</span>)&#59;
<a class="l" name="45" href="#45">45</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#sec" data-definition-place="defined-in-file">sec</a> = <a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a> - (<a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a> &gt;&gt; <span class="n">2</span>)&#59;
<a class="l" name="46" href="#46">46</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#sec" data-definition-place="defined-in-file">sec</a> = <a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a> - (<a class="d intelliWindow-symbol" href="#sec" data-definition-place="defined-in-file">sec</a> &gt;&gt; <span class="n">5</span>)&#59;
<a class="l" name="47" href="#47">47</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#sec" data-definition-place="defined-in-file">sec</a> = <a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a> + (<a class="d intelliWindow-symbol" href="#sec" data-definition-place="defined-in-file">sec</a> &gt;&gt; <span class="n">1</span>)&#59;
<a class="l" name="48" href="#48">48</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#sec" data-definition-place="defined-in-file">sec</a> = <a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a> - (<a class="d intelliWindow-symbol" href="#sec" data-definition-place="defined-in-file">sec</a> &gt;&gt; <span class="n">6</span>) + <span class="n">7</span>&#59;
<a class="l" name="49" href="#49">49</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#sec" data-definition-place="defined-in-file">sec</a> = <a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a> - (<a class="d intelliWindow-symbol" href="#sec" data-definition-place="defined-in-file">sec</a> &gt;&gt; <span class="n">3</span>)&#59;
<a class="hl" name="50" href="#50">50</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#sec" data-definition-place="defined-in-file">sec</a> = <a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a> + (<a class="d intelliWindow-symbol" href="#sec" data-definition-place="defined-in-file">sec</a> &gt;&gt; <span class="n">1</span>)&#59;
<a class="l" name="51" href="#51">51</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#sec" data-definition-place="defined-in-file">sec</a> = <a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a> + (<a class="d intelliWindow-symbol" href="#sec" data-definition-place="defined-in-file">sec</a> &gt;&gt; <span class="n">3</span>)&#59;
<a class="l" name="52" href="#52">52</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#sec" data-definition-place="defined-in-file">sec</a> = <a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a> + (<a class="d intelliWindow-symbol" href="#sec" data-definition-place="defined-in-file">sec</a> &gt;&gt; <span class="n">4</span>)&#59;
<a class="l" name="53" href="#53">53</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a> = (<a class="d intelliWindow-symbol" href="#sec" data-definition-place="defined-in-file">sec</a> &lt;&lt; <span class="n">7</span>) - <a class="d intelliWindow-symbol" href="#sec" data-definition-place="defined-in-file">sec</a> - <a class="d intelliWindow-symbol" href="#sec" data-definition-place="defined-in-file">sec</a> - <a class="d intelliWindow-symbol" href="#sec" data-definition-place="defined-in-file">sec</a>&#59;
<a class="l" name="54" href="#54">54</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a> = (<a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a> &lt;&lt; <span class="n">7</span>) - <a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a> - <a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a> - <a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a>&#59;
<a class="l" name="55" href="#55">55</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a> = (<a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a> &lt;&lt; <span class="n">7</span>) - <a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a> - <a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a> - <a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a>&#59;
<a class="l" name="56" href="#56">56</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#nsec" data-definition-place="defined-in-file">nsec</a> = (<a href="/source/s?defs=uint32_t" class="intelliWindow-symbol" data-definition-place="undefined-in-file">uint32_t</a>)<a class="d intelliWindow-symbol" href="#hrt" data-definition-place="defined-in-file">hrt</a> - (<a class="d intelliWindow-symbol" href="#tmp" data-definition-place="defined-in-file">tmp</a> &lt;&lt; <span class="n">9</span>)&#59;
<a class="l" name="57" href="#57">57</a><span class='fold-space'>&nbsp;</span>	<b>while</b> (<a class="d intelliWindow-symbol" href="#nsec" data-definition-place="defined-in-file">nsec</a> &gt;= <a href="/source/s?defs=NANOSEC" class="intelliWindow-symbol" data-definition-place="undefined-in-file">NANOSEC</a>) &#123;
<a class="l" name="58" href="#58">58</a><span class='fold-space'>&nbsp;</span>		<a class="d intelliWindow-symbol" href="#nsec" data-definition-place="defined-in-file">nsec</a> -= <a href="/source/s?defs=NANOSEC" class="intelliWindow-symbol" data-definition-place="undefined-in-file">NANOSEC</a>&#59;
<a class="l" name="59" href="#59">59</a><span class='fold-space'>&nbsp;</span>		<a class="d intelliWindow-symbol" href="#sec" data-definition-place="defined-in-file">sec</a>++&#59;
<a class="hl" name="60" href="#60">60</a><span class='fold-space'>&nbsp;</span>	&#125;
<a class="l" name="61" href="#61">61</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#tsp" data-definition-place="defined-in-file">tsp</a>-&gt;<a href="/source/s?defs=tv_sec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_sec</a> = (<a href="/source/s?defs=time_t" class="intelliWindow-symbol" data-definition-place="undefined-in-file">time_t</a>)<a class="d intelliWindow-symbol" href="#sec" data-definition-place="defined-in-file">sec</a>&#59;
<a class="l" name="62" href="#62">62</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#tsp" data-definition-place="defined-in-file">tsp</a>-&gt;<a href="/source/s?defs=tv_nsec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_nsec</a> = <a class="d intelliWindow-symbol" href="#nsec" data-definition-place="defined-in-file">nsec</a>&#59;
<a class="l" name="63" href="#63">63</a><span class='fold-space'>&nbsp;</span>&#125;
</span><a class="l" name="64" href="#64">64</a><span class='fold-space'>&nbsp;</span>
<a class="l" name="65" href="#65">65</a><span class='fold-space'>&nbsp;</span><span class="c">/*
<a class="l" name="66" href="#66">66</a><span class='fold-space'>&nbsp;</span> * Convert absolute time to relative time.
<a class="l" name="67" href="#67">67</a><span class='fold-space'>&nbsp;</span> * All *timedwait() system call traps expect relative time.
<a class="l" name="68" href="#68">68</a><span class='fold-space'>&nbsp;</span> */</span>
<a class="l" name="69" href="#69">69</a><span class='fold-space'>&nbsp;</span><b>void</b>
<span id='scope_id_eb746c64' class='scope-head'><span class='scope-signature'>abstime_to_reltime(clockid_t clock_id,const timespec_t * abstime,timespec_t * reltime)</span><a class="hl" name="70" href="#70">70</a><a style='cursor:pointer;' onclick='fold(this.parentNode.id)' id='scope_id_eb746c64_fold_icon'><span class='fold-icon'>&nbsp;</span></a><a class="xf" name="abstime_to_reltime"/><a href="/source/s?refs=abstime_to_reltime" class="xf intelliWindow-symbol" data-definition-place="def">abstime_to_reltime</a>(<a href="/source/s?defs=clockid_t" class="intelliWindow-symbol" data-definition-place="undefined-in-file">clockid_t</a> <a class="xa" name="clock_id"/><a href="/source/s?refs=clock_id" class="xa intelliWindow-symbol" data-definition-place="def">clock_id</a>,</span>
<span id='scope_id_eb746c64_fold' class='scope-body'><a class="l" name="71" href="#71">71</a><span class='fold-space'>&nbsp;</span>	<b>const</b> <a href="/source/s?defs=timespec_t" class="intelliWindow-symbol" data-definition-place="undefined-in-file">timespec_t</a> *<a class="d intelliWindow-symbol" href="#abstime" data-definition-place="defined-in-file">abstime</a>, <a href="/source/s?defs=timespec_t" class="intelliWindow-symbol" data-definition-place="undefined-in-file">timespec_t</a> *<a class="d intelliWindow-symbol" href="#reltime" data-definition-place="defined-in-file">reltime</a>)
<a class="l" name="72" href="#72">72</a><span class='fold-space'>&nbsp;</span>&#123;
<a class="l" name="73" href="#73">73</a><span class='fold-space'>&nbsp;</span>	<b>extern</b> <b>int</b> <a href="/source/s?defs=__clock_gettime" class="intelliWindow-symbol" data-definition-place="undefined-in-file">__clock_gettime</a>(<a href="/source/s?defs=clockid_t" class="intelliWindow-symbol" data-definition-place="undefined-in-file">clockid_t</a>, <a href="/source/s?defs=timespec_t" class="intelliWindow-symbol" data-definition-place="undefined-in-file">timespec_t</a> *)&#59;
<a class="l" name="74" href="#74">74</a><span class='fold-space'>&nbsp;</span>	<a href="/source/s?defs=timespec_t" class="intelliWindow-symbol" data-definition-place="undefined-in-file">timespec_t</a> <a class="xl" name="now"/><a href="/source/s?refs=now" class="xl intelliWindow-symbol" data-definition-place="def">now</a>&#59;
<a class="l" name="75" href="#75">75</a><span class='fold-space'>&nbsp;</span>
<a class="l" name="76" href="#76">76</a><span class='fold-space'>&nbsp;</span>	<b>if</b> (<a class="d intelliWindow-symbol" href="#clock_id" data-definition-place="defined-in-file">clock_id</a> == <a href="/source/s?defs=CLOCK_HIGHRES" class="intelliWindow-symbol" data-definition-place="undefined-in-file">CLOCK_HIGHRES</a>)
<a class="l" name="77" href="#77">77</a><span class='fold-space'>&nbsp;</span>		<a class="d intelliWindow-symbol" href="#hrt2ts" data-definition-place="defined-in-file">hrt2ts</a>(<a href="/source/s?defs=gethrtime" class="intelliWindow-symbol" data-definition-place="undefined-in-file">gethrtime</a>(), &amp;<a class="d intelliWindow-symbol" href="#now" data-definition-place="defined-in-file">now</a>)&#59;
<a class="l" name="78" href="#78">78</a><span class='fold-space'>&nbsp;</span>	<b>else</b>
<a class="l" name="79" href="#79">79</a><span class='fold-space'>&nbsp;</span>		(<b>void</b>) <a href="/source/s?defs=__clock_gettime" class="intelliWindow-symbol" data-definition-place="undefined-in-file">__clock_gettime</a>(<a class="d intelliWindow-symbol" href="#clock_id" data-definition-place="defined-in-file">clock_id</a>, &amp;<a class="d intelliWindow-symbol" href="#now" data-definition-place="defined-in-file">now</a>)&#59;
<a class="hl" name="80" href="#80">80</a><span class='fold-space'>&nbsp;</span>	<b>if</b> (<a class="d intelliWindow-symbol" href="#abstime" data-definition-place="defined-in-file">abstime</a>-&gt;<a href="/source/s?defs=tv_nsec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_nsec</a> &gt;= <a class="d intelliWindow-symbol" href="#now" data-definition-place="defined-in-file">now</a>.<a href="/source/s?defs=tv_nsec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_nsec</a>) &#123;
<a class="l" name="81" href="#81">81</a><span class='fold-space'>&nbsp;</span>		<a class="d intelliWindow-symbol" href="#reltime" data-definition-place="defined-in-file">reltime</a>-&gt;<a href="/source/s?defs=tv_sec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_sec</a> = <a class="d intelliWindow-symbol" href="#abstime" data-definition-place="defined-in-file">abstime</a>-&gt;<a href="/source/s?defs=tv_sec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_sec</a> - <a class="d intelliWindow-symbol" href="#now" data-definition-place="defined-in-file">now</a>.<a href="/source/s?defs=tv_sec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_sec</a>&#59;
<a class="l" name="82" href="#82">82</a><span class='fold-space'>&nbsp;</span>		<a class="d intelliWindow-symbol" href="#reltime" data-definition-place="defined-in-file">reltime</a>-&gt;<a href="/source/s?defs=tv_nsec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_nsec</a> = <a class="d intelliWindow-symbol" href="#abstime" data-definition-place="defined-in-file">abstime</a>-&gt;<a href="/source/s?defs=tv_nsec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_nsec</a> - <a class="d intelliWindow-symbol" href="#now" data-definition-place="defined-in-file">now</a>.<a href="/source/s?defs=tv_nsec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_nsec</a>&#59;
<a class="l" name="83" href="#83">83</a><span class='fold-space'>&nbsp;</span>	&#125; <b>else</b> &#123;
<a class="l" name="84" href="#84">84</a><span class='fold-space'>&nbsp;</span>		<a class="d intelliWindow-symbol" href="#reltime" data-definition-place="defined-in-file">reltime</a>-&gt;<a href="/source/s?defs=tv_sec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_sec</a> = <a class="d intelliWindow-symbol" href="#abstime" data-definition-place="defined-in-file">abstime</a>-&gt;<a href="/source/s?defs=tv_sec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_sec</a> - <a class="d intelliWindow-symbol" href="#now" data-definition-place="defined-in-file">now</a>.<a href="/source/s?defs=tv_sec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_sec</a> - <span class="n">1</span>&#59;
<a class="l" name="85" href="#85">85</a><span class='fold-space'>&nbsp;</span>		<a class="d intelliWindow-symbol" href="#reltime" data-definition-place="defined-in-file">reltime</a>-&gt;<a href="/source/s?defs=tv_nsec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_nsec</a> = <a class="d intelliWindow-symbol" href="#abstime" data-definition-place="defined-in-file">abstime</a>-&gt;<a href="/source/s?defs=tv_nsec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_nsec</a> - <a class="d intelliWindow-symbol" href="#now" data-definition-place="defined-in-file">now</a>.<a href="/source/s?defs=tv_nsec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_nsec</a> + <a href="/source/s?defs=NANOSEC" class="intelliWindow-symbol" data-definition-place="undefined-in-file">NANOSEC</a>&#59;
<a class="l" name="86" href="#86">86</a><span class='fold-space'>&nbsp;</span>	&#125;
<a class="l" name="87" href="#87">87</a><span class='fold-space'>&nbsp;</span>	<span class="c">/*
<a class="l" name="88" href="#88">88</a><span class='fold-space'>&nbsp;</span>	 * If the absolute time has already passed,
<a class="l" name="89" href="#89">89</a><span class='fold-space'>&nbsp;</span>	 * just set the relative time to zero.
<a class="hl" name="90" href="#90">90</a><span class='fold-space'>&nbsp;</span>	 */</span>
<a class="l" name="91" href="#91">91</a><span class='fold-space'>&nbsp;</span>	<b>if</b> (<a class="d intelliWindow-symbol" href="#reltime" data-definition-place="defined-in-file">reltime</a>-&gt;<a href="/source/s?defs=tv_sec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_sec</a> &lt; 0) &#123;
<a class="l" name="92" href="#92">92</a><span class='fold-space'>&nbsp;</span>		<a class="d intelliWindow-symbol" href="#reltime" data-definition-place="defined-in-file">reltime</a>-&gt;<a href="/source/s?defs=tv_sec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_sec</a> = 0&#59;
<a class="l" name="93" href="#93">93</a><span class='fold-space'>&nbsp;</span>		<a class="d intelliWindow-symbol" href="#reltime" data-definition-place="defined-in-file">reltime</a>-&gt;<a href="/source/s?defs=tv_nsec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_nsec</a> = 0 + <span class="n">0xFFFF</span> - <span class="n">0xFF</span> - <span class="n">0XFF00</span>&#59;
<a class="l" name="94" href="#94">94</a><span class='fold-space'>&nbsp;</span>	&#125;
<a class="l" name="95" href="#95">95</a><span class='fold-space'>&nbsp;</span>	<span class="c">/*
<a class="l" name="96" href="#96">96</a><span class='fold-space'>&nbsp;</span>	 * If the specified absolute time has a bad nanoseconds value,
<a class="l" name="97" href="#97">97</a><span class='fold-space'>&nbsp;</span>	 * assign it to the relative time value.  If the interface
<a class="l" name="98" href="#98">98</a><span class='fold-space'>&nbsp;</span>	 * attempts to sleep, the bad value will be detected then.
<a class="l" name="99" href="#99">99</a><span class='fold-space'>&nbsp;</span>	 * The SUSV3 Posix spec is very clear that such detection
<a class="hl" name="100" href="#100">100</a><span class='fold-space'>&nbsp;</span>	 * should not happen until an attempt to sleep is made.
<a class="l" name="101" href="#101">101</a><span class='fold-space'>&nbsp;</span>	 */</span>
<a class="l" name="102" href="#102">102</a><span class='fold-space'>&nbsp;</span>	<b>if</b> ((<a href="/source/s?defs=ulong_t" class="intelliWindow-symbol" data-definition-place="undefined-in-file">ulong_t</a>)<a class="d intelliWindow-symbol" href="#abstime" data-definition-place="defined-in-file">abstime</a>-&gt;<a href="/source/s?defs=tv_nsec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_nsec</a> &gt;= <a href="/source/s?defs=NANOSEC" class="intelliWindow-symbol" data-definition-place="undefined-in-file">NANOSEC</a>)
<a class="l" name="103" href="#103">103</a><span class='fold-space'>&nbsp;</span>		<a class="d intelliWindow-symbol" href="#reltime" data-definition-place="defined-in-file">reltime</a>-&gt;<a href="/source/s?defs=tv_nsec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_nsec</a> = <a class="d intelliWindow-symbol" href="#abstime" data-definition-place="defined-in-file">abstime</a>-&gt;<a href="/source/s?defs=tv_nsec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">tv_nsec</a>&#59;
<a class="l" name="104" href="#104">104</a><span class='fold-space'>&nbsp;</span>
<a class="l" name="105" href="#105">105</a><span class='fold-space'>&nbsp;</span>	<b>int</b> <a class="xl" name="dec"/><a href="/source/s?refs=dec" class="xl intelliWindow-symbol" data-definition-place="def">dec</a> = <span class="n">42</span>&#59;
<a class="l" name="106" href="#106">106</a><span class='fold-space'>&nbsp;</span>	<b>int</b> <a class="xl" name="o"/><a href="/source/s?refs=o" class="xl intelliWindow-symbol" data-definition-place="def">o</a> = <span class="n">052</span>&#59;
<a class="l" name="107" href="#107">107</a><span class='fold-space'>&nbsp;</span>	<b>int</b> <a class="xl" name="x"/><a href="/source/s?refs=x" class="xl intelliWindow-symbol" data-definition-place="def">x</a> = <span class="n">0x2a</span>&#59;
<a class="l" name="108" href="#108">108</a><span class='fold-space'>&nbsp;</span>	<b>int</b> <a class="xl" name="X"/><a href="/source/s?refs=X" class="xl intelliWindow-symbol" data-definition-place="def">X</a> = <span class="n">0X2A</span>&#59;
<a class="l" name="109" href="#109">109</a><span class='fold-space'>&nbsp;</span>	<b>unsigned</b> <b>long</b> <b>long</b> <a class="xl" name="ull"/><a href="/source/s?refs=ull" class="xl intelliWindow-symbol" data-definition-place="def">ull</a> = <span class="n">12345678901234567890ull</span>&#59;
<a class="hl" name="110" href="#110">110</a><span class='fold-space'>&nbsp;</span>	<b>unsigned</b> <b>long</b> <a class="xl" name="u"/><a href="/source/s?refs=u" class="xl intelliWindow-symbol" data-definition-place="def">u</a> = <span class="n">12345678901234567890u</span>&#59;
<a class="l" name="111" href="#111">111</a><span class='fold-space'>&nbsp;</span>
<a class="l" name="112" href="#112">112</a><span class='fold-space'>&nbsp;</span>	<b>double</b> <a class="xl" name="d"/><a href="/source/s?refs=d" class="xl intelliWindow-symbol" data-definition-place="def">d</a> = <span class="n">0x1.2p3</span>&#59; <span class="c">/* hex frac 1.2(dec 1.125) scaled by 2^3, i.e. 9.0*/</span>
<a class="l" name="113" href="#113">113</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#d" data-definition-place="defined-in-file">d</a> = <span class="n">1.2e3</span>&#59;
<a class="l" name="114" href="#114">114</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#d" data-definition-place="defined-in-file">d</a> = <span class="n">1e0</span>&#59;
<a class="l" name="115" href="#115">115</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#d" data-definition-place="defined-in-file">d</a> = <span class="n">1.</span>&#59;
<a class="l" name="116" href="#116">116</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#d" data-definition-place="defined-in-file">d</a> = <span class="n">.1</span>&#59;
<a class="l" name="117" href="#117">117</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#d" data-definition-place="defined-in-file">d</a> = <span class="n">15.0</span>&#59;
<a class="l" name="118" href="#118">118</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#d" data-definition-place="defined-in-file">d</a> = <span class="n">0x1.ep+3</span>&#59;
<a class="l" name="119" href="#119">119</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#d" data-definition-place="defined-in-file">d</a> = <span class="n">2.0e+308</span>&#59;
<a class="hl" name="120" href="#120">120</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#d" data-definition-place="defined-in-file">d</a> = <span class="n">1.0e-324</span>&#59;
<a class="l" name="121" href="#121">121</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#d" data-definition-place="defined-in-file">d</a> = <span class="n">-1.0e-324</span>&#59;
<a class="l" name="122" href="#122">122</a><span class='fold-space'>&nbsp;</span>	<a class="d intelliWindow-symbol" href="#d" data-definition-place="defined-in-file">d</a> = <span class="n">-2.0e+308</span>&#59;
<a class="l" name="123" href="#123">123</a><span class='fold-space'>&nbsp;</span>&#125;
</span><a class="l" name="124" href="#124">124</a><span class='fold-space'>&nbsp;</span>
<a class="l" name="125" href="#125">125</a><span class='fold-space'>&nbsp;</span><span class="c">/*<a href="http://example.com">http://example.com</a>*/</span>
<a class="l" name="126" href="#126">126</a><span class='fold-space'>&nbsp;</span></body>
</html>
